#pragma once

#include <fstream>
#include <vector>

class SearchManager;
class QueryManager;
class TermManager;
class DocumentManager;


class RankingModel
{

public:
	RankingModel(SearchManager * pSM, QueryManager * pQM, std::string outFile);
	void DisplayResult( unsigned int printCount );		// just display result of "CURRENT CALCULATED RANKING"
														// for removing duplicated calculation
	virtual void RankingQuery( unsigned int queryIndex, unsigned int printCount ) = 0;
	virtual ~RankingModel(void);
	typedef std::map< unsigned int, double > ScoreMap;

protected:
	QueryManager* m_pQueryManager;
	SearchManager* m_pSearchManager;
	std::ofstream	m_ofs;
	std::vector< std::pair<unsigned int, double> > docRanking;
	
	virtual void DisplayResult( unsigned int queryIndex, unsigned int printCount );
};

bool ascending (std::pair<unsigned int, double> i,std::pair<unsigned int, double> j);
bool descending (std::pair<unsigned int, double> i,std::pair<unsigned int, double> j);